package com.dayuanit.dy17.library.controller;

import com.dayuanit.dy17.library.entity.Press;
import com.dayuanit.dy17.library.service.IPressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Component
public class PressController extends BaseController {

    @Autowired
    private IPressService pressService;

    public PressController() {
        System.out.println("------PressController()-------");
    }

    @RequestMapping(value = "/press/queryPress.do")
    public Press queryPress(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String pressName = req.getParameter("pressName");

        Press press = pressService.queryPress(pressName);
        return press;
    }
}
